from typing import List


class Solution:
    def firstPalindrome(self, words: List[str]) -> str:
        for s in words:
            if self.CheckPalindrome(s):
                return s

        return ""

    def CheckPalindrome(self, text: str):
        n = len(text)

        if n == 1:
            return True

        for i in range(n // 2 + 1):
            if text[i] == text[n - i - 1]:
                continue
            else:
                return False

        return True


if __name__ == '__main__':
    a = Solution();
    print(a.firstPalindrome(["def","ghi"]))
